package com.migo.service.impl;

import com.migo.dao.PvMgFirmwareDao;
import com.migo.entity.PvMgFirmwareEntity;
import com.migo.service.PvMgFirmwareService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;


@Service("pvMgFirmwareService")
public class PvMgFirmwareServiceImpl implements PvMgFirmwareService {
    @Autowired
    private PvMgFirmwareDao pvMgFirmwareDao;

    @Value("${ossUrl}")
    String ossUrl;


    @Override
    public PvMgFirmwareEntity queryObject(Integer id) {
        return pvMgFirmwareDao.queryObject(id);
    }

    @Override
    public List<PvMgFirmwareEntity> queryList(Map<String, Object> map) {
        return pvMgFirmwareDao.queryList(map);
    }

    @Override
    public List<PvMgFirmwareEntity> queryLastVersionList(Map<String, Object> map) {
        return pvMgFirmwareDao.queryLastVersionList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return pvMgFirmwareDao.queryTotal(map);
    }

    @Override
    public void save(PvMgFirmwareEntity pvMgFirmware) {
        pvMgFirmware.setCreateTime(new Date());
        pvMgFirmware.setUpdateTime(new Date());
        pvMgFirmwareDao.save(pvMgFirmware);
    }

    @Override
    public void update(PvMgFirmwareEntity pvMgFirmware) {
        pvMgFirmwareDao.update(pvMgFirmware);
    }

    @Override
    public void delete(Integer id) {
        pvMgFirmwareDao.delete(id);
    }

    @Override
    public void deleteBatch(Integer[] ids) {
        pvMgFirmwareDao.deleteBatch(ids);
    }


    @Override
    public PvMgFirmwareEntity queryFirmwareVersionByType(Map<String, Object> map) {
        return pvMgFirmwareDao.queryFirmwareVersionByType(map);
    }
}
